import java.util.Scanner;

//验证字符串是否为回文串，只考虑字母和数字字符，忽略字母大小写
public class Test3 {
    public static boolean isEffective(char ch){
        if(Character.isDigit(ch) || Character.isLetter(ch)){
            return true;
        }
        return false;
    }

    public static boolean isPalindrome(String s){
        int left = 0;
        int right = s.length()-1;
        while (left < right){
            while (left < right){
                if (!isEffective(s.charAt(left))){
                    left++;
                }else{
                    break;
                }
            }
            while (left < right){
                if (!isEffective(s.charAt(right))){
                    right--;
                }else {
                    break;
                }
            }
            if(s.charAt(left) != s.charAt(right)){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        s = s.toLowerCase();
        System.out.println(isPalindrome(s));
    }
}
